<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改消息列')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-message-edit" th:object="${messgaeInfo}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">标题：</label>
                <div class="col-sm-8">
                    <input name="title" th:field="*{title}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">消息类型：</label>
                <div class="col-sm-8" th:if="${messgaeInfo.type==1}" >
                    <label class="radio-box"><input type="radio" value="1" checked="" name="type">服务商消息</label>
                    <label class="radio-box"><input type="radio" value="2" name="type">商户消息</label>
                </div>
                <div class="col-sm-8" th:if="${messgaeInfo.type==2}" >
                    <label class="radio-box"><input type="radio" value="1"  name="type">服务商消息</label>
                    <label class="radio-box"><input type="radio" value="2" checked="" name="type">商户消息</label>
                </div>

            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">类型：</label>
                <div class="col-sm-8">
                    <select name="status" class="form-control m-b">
                        <option value="1" th:field="*{status}">系统消息</option>
                        <option value="2" th:field="*{status}">小喇叭消息</option>
                        <option value="3" th:field="*{status}">常见问题</option>
                        <option value="4" th:field="*{status}">活动消息</option>
                        <option value="5" th:field="*{status}">奖励消息</option>
                        <option value="6" th:field="*{status}">公告消息</option>
                        <option value="7" th:field="*{status}">订单消息</option>
                        <option value="8" th:field="*{status}">机具消息</option>
                        <option value="9" th:field="*{status}">雏鹰入口</option>
                        <option value="10" th:field="*{status}">雏鹰详情</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">极光推送消息状态：</label>
                <div class="col-sm-8" th:if="${messgaeInfo.jgStatus==0}" >
                    <label class="radio-box"><input type="radio" value="0" checked="" name="jgStatus">未推送</label>
                    <label class="radio-box"><input type="radio" value="1" name="jgStatus">已推送</label>
                </div>
                <div class="col-sm-8" th:if="${messgaeInfo.jgStatus==1}" >
                    <label class="radio-box"><input type="radio" value="0"  name="jgStatus">未推送</label>
                    <label class="radio-box"><input type="radio" value="1" checked="" name="jgStatus">已推送</label>
                </div>

            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">限制档位：</label>
                <div class="col-sm-8">
                    <select name="grade" class="form-control m-b">
                        <option value="">请选择</option>
                        <option value="V1" th:field="*{grade}">V1</option>
                        <option value="V2" th:field="*{grade}">V2</option>
                        <option value="V3" th:field="*{grade}">V3</option>
                        <option value="V4" th:field="*{grade}">V4</option>
                        <option value="V5" th:field="*{grade}">V5</option>
                        <option value="V6" th:field="*{grade}">V6</option>
                        <option value="V7" th:field="*{grade}">V7</option>
                        <option value="V8" th:field="*{grade}">V8</option>
                        <option value="V9" th:field="*{grade}">V9</option>
                        <option value="V10" th:field="*{grade}">V10</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">消息内容：</label>
                <div class="col-sm-8">
                    <textarea cols="10" rows="10" th:field="*{content}" name="content" class="form-control" required></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "message/message";
        $("#form-message-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-message-edit').serialize());
            }
        }
    </script>
</body>
</html>